This page last changed on Aug 13, 2007 by cholmes.
Geoserver now supports the notion of having a layer-group. A layer-group is a group of layers that can be refered to by one layer name.
For example, if you put three layers (call them layer_A, layer_B, and layer_C) under the one "Layer-group" layer, then when a user makes a WMS getMap request for that group name, they will get a map of those three layers.
The layer grouping option is just a convenient way to avoid having to list many layers every time you make a WMS request. It essentially just looks at the layer group name in the WMS request, and replaces it with the layers that it represents; then the WMS request it processed.
Examples
Say I create a layer group called "Water". I then tell it that the layers in that group are "lakes, rivers, oceans" (these are existing layers called 'lakes', 'rivers', 'ocreans'). Now when I make a WMS request to "Water" I will get back those three layers: 'lakes', 'rivers', 'ocreans'. These three layers are combined into one image and that is returned to the user. I can still make individual requests to those layers, and will get the individual layers back.
Configuration
The layer-group option can be configured in the WMS configuration page of the web-admin UI.
Just navigate to Config -> WMS -> Contents
then:
- Add a new layer group with the 'Add New Layer-Group' button at the bottom of the page.
- Give your Layer-group a name in the "Layer-group Name" field. This is what you will use to request the group
- List the layers, separated by commas, in the "Base-map Layers" field.
- List the styles, separated by commas, in the "Base-map Styles" field. If you leave it blank it will use default styles
- Hit 'Generate' to automatically create the bounds, or put in your own custom numbers.
- Hit submit and Apply.
You can also remove an existing layer group by hitting 'remove' by its name.
Now make a WMS get map request for the "Layer-group Name", you will get a map with the layers you specified rendered with the styles you specified.
|